package com.fjrcloud.utils;

/**
 * Author: Trun
 * Date: 2016-11-22
 * Description: ExpandLogger.java
 */

public class ExpandLogger {

    private Class c = null;
    private Boolean printEnable = true;

    public ExpandLogger() {
    }

    public ExpandLogger(Class c) {
        this.c = c;
    }

    public void info(String value){
        if (printEnable) {
            System.out.println(getJavaName()+':'+value);
        }
    }
    public void error(String value,Exception e){
        if (printEnable) {
            System.out.println(getJavaName()+':'+value);
            System.out.println(e.getMessage());
        }
    }
    public String getJavaName(){
        return c.getName();
    }

    public static ExpandLogger instance(){
        return new ExpandLogger();
    }
    public static ExpandLogger instance(Class c){
        return new ExpandLogger(c);
    }

}
